﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Register Src="../Shared/Header.ascx" TagName="Header" TagPrefix="uc1" %>
<!DOCTYPE html>

<html>
<head runat="server">
    <title>操作流程查询</title>
    <uc1:Header ID="Header1" runat="server" />
    <script type="text/javascript" language="javascript">
        $(function () {

        });

        function reset() {
            $("#CaoZLC").combobox("setValue", "1");
            $("#CaoZRQ").datebox("setValue", "");            
        }

        var hasquery = false;
        var columns1 = [[
                { field: 'TiaoMH', title: '条码号', width: 80 }
                , { field: 'BaoMC', title: '包名称', width: 80 }
                , { field: 'QingXQGH', title: '清洗锅号', width: 80 }
                , { field: 'QingXQGC', title: '清洗锅次', width: 80 }
                , { field: 'BaoZR', title: '包装人', width: 80 }
                , { field: 'BaoZRQ', title: '包装日期', width: 80 }
                , { field: 'BaoZSJ', title: '包装时间', width: 80 }
                , { field: 'ZhuangT', title: '状态', width: 80, formatter: zhuangtFormatter }
                ]];
        var columns2 = [[
                { field: 'TiaoMH', title: '条码号', width: 80 }
                , { field: 'BaoMC', title: '包名称', width: 80 }
                , { field: 'YouXQ', title: '有效期(天)', width: 80 }
                , { field: 'MieJGH', title: '灭菌锅号', width: 80 }
                , { field: 'MieJGC', title: '灭菌锅次', width: 80 }
                , { field: 'MieJRQ', title: '灭菌日期', width: 80 }
                , { field: 'MieJSJ', title: '灭菌时间', width: 80 }
                , { field: 'ShiXSJ', title: '失效日期', width: 80 }
                , { field: 'ZhuangT', title: '状态', width: 80, formatter: zhuangtFormatter }
                ]];
        var columns3 = [[
                { field: 'TiaoMH', title: '条码号', width: 80 }
                , { field: 'BaoMC', title: '包名称', width: 80 }
                , { field: 'LingYKS', title: '领用科室', width: 80 }
                , { field: 'LingYR', title: '领用人', width: 80, formatter: lingyrFormatter }
                , { field: 'ShiYR', title: '使用人', width: 80, formatter: lingyrFormatter }
                , { field: 'ShiXSJ', title: '失效日期', width: 80 }
                , { field: 'FaFRQ', title: '发放日期', width: 80 }
                , { field: 'FaFSJ', title: '发放时间', width: 80 }
                , { field: 'FaFR', title: '发放人', width: 80 }
                , { field: 'ZhuangT', title: '状态', width: 80, formatter: zhuangtFormatter }
                ]];
        var columns4 = [[
                { field: 'TiaoMH', title: '条码号', width: 80 }
                , { field: 'BaoMC', title: '包名称', width: 80 }
                , { field: 'LingYKS', title: '领用科室', width: 80 }
                , { field: 'LingYR', title: '领用人', width: 80, formatter: lingyrFormatter }
                , { field: 'ShiYR', title: '使用人', width: 80, formatter: lingyrFormatter }
                , { field: 'FaFRQ', title: '发放日期', width: 80 }
                , { field: 'FaFSJ', title: '发放时间', width: 80 }
                , { field: 'FaFR', title: '发放人', width: 80 }
                , { field: 'HuiSRQ', title: '回收日期', width: 80 }
                , { field: 'HuiSSJ', title: '回收时间', width: 80 }
                , { field: 'HuiSR', title: '回收人/清洗人', width: 80 }
                , { field: 'ZhuangT', title: '状态', width: 80, formatter: zhuangtFormatter }
                ]];
        function submit() {

            var strCaoZLC = $("#CaoZLC").combogrid("getValue");
            var strCaoZRQ = $("#CaoZRQ").datebox("getValue");
            if (!hasquery) {
                $('#grid').datagrid({
                    iconCls: 'icon-save',
                    nowrap: false,                      //设置为true，当数据长度超出列宽时将会自动截取
                    striped: true,                      //奇偶行使用不同背景色
                    url: '',                            //从远程站点请求数据的 URL
                    fitColumns: true,                   //适应表格的宽度并且防止水平滚动
                    fit: true,
                    idField: 'Id',                      //标识字段
                    remoteSort: false,                  //定义是否从服务器给数据排序
                    singleSelect: true,                 //是否允许选中一行
                    pagination: true,                  //分页
                    rownumbers: true,                    //行号
                    pageSize: 20,                        //每页记录数
                    pageList: [10, 20, 30]             //每页记录数列表      
                });
                hasquery = true;
                setColumn(strCaoZLC, strCaoZRQ);               
            }
            else {
                setColumn(strCaoZLC, strCaoZRQ);                 
            }
        }

        function setColumn(strCaoZLC, strCaoZRQ) {
            var options = {};
            options.queryParams = {
                CaoZLC: strCaoZLC,
                CaoZRQ: strCaoZRQ
            };
            options.url = "/Query/LoadIndex2/";
            if (strCaoZLC.toString() == "1") { options.columns = columns1; }
            else if (strCaoZLC.toString() == "2") { options.columns = columns2; }
            else if (strCaoZLC.toString() == "3") { options.columns = columns3; }
            else { options.columns = columns4; }

            $('#grid').datagrid(options);
            $('#grid').datagrid('load');    
        }    

    </script>
</head>
<body class="easyui-layout">
    <div id="north_Index1" region="north" style="padding:5px;" border="false"> 
        
        <table style="width:100%; background-color:#EFEFEF; font-size:12px;" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td colspan="6" style="border-bottom:1px solid #CCCCCC; line-height:2;"><span style="padding-left:10px;">请输入你要查询的条件：</span></td>
                <td style="border-bottom:1px solid #CCCCCC;">
                    
                </td>
            </tr>
            <tr>
                <td style="text-align: right; width: 80px;padding-top:2px;">操作流程：</td>
                <td style="text-align: left; width: 142px;padding-top:2px;">
                    <select id="CaoZLC" class="easyui-combobox" name="CaoZLC" style="width:140px;" panelHeight="auto">
		                <option value="1" selected>包装</option>
		                <option value="2">灭菌</option>
		                <option value="3">发放</option>
		                <option value="4">回收</option>
                    </select>
                </td>
                <td style="text-align:right;"></td>
            </tr>
            <tr>
                <td style="text-align: right; width: 80px;">操作日期：</td>
                <td style="text-align: left; width: 142px;">
                    <input id="CaoZRQ" type="text" class="easyui-datebox" style="width:140px;"/>
                </td>
                <td style="padding-left:20px;">   
                    <a id="btnQuery" href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-search" plain="true" onclick="submit()">查询</a>
                    <a id="btnReset" href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-redo" plain="true" onclick="reset()">重写</a>                 
                </td>
            </tr>
        </table>
                        
    </div>
    <div region="center" style="padding: 0 5px 5px 5px;" border="false">        
        <table id="grid" style="display:none">
        </table>
    </div>
    <div id="win" />
</body>
</html>
